vcolobasic = 'w+/rb,gr+/r'
SAVE SCREEN TO vscreen
SET COLO TO W+/R
@ 24,0 CLEAR
STORE 0 TO vadd
DO BOX2 WITH 22,20,"DO YOU WANT TO ? :","ADD NATIONALITY","CANCEL",'GR+','RB','GR+','R',VADD,.F.,.T.

**
** 8/14/00 - don't allow the users to add new Nationality code
**   - by always returning to the calling program
**IF LASTKEY()=27 .OR. VADD=2
   REST SCREEN FROM vscreen
   RETURN
**ENDIF
REST SCREEN FROM vscreen
SET COLO TO W+/rb,w+/n+
@ 13,3 CLEAR TO 17,52
@ 13,3 TO 17,52 DOUBLE
@ 13,19 SAY '[Input Nationality]'
@ 14,9 SAY 'Country Name   :'
@ 15,9 say 'Country Code   :'
@ 16,9 say 'Nationality    :'
*set colo to
@ 14,26 say space(15)
@ 15,26 say space(4)
@ 16,26 say space(24)
STORE SPACE(4) TO vcode
STORE SPACE(20) TO vciti
STORE SPACE(15) TO vname
SAVE SCREEN TO VSCREEN1
DO WHILE .T.
*   SET INTEN ON
   @ 14,26 GET vname PICT '@!'
   READ
   IF vname =  SPACE(15)
      REST SCREEN FROM VSCREEN1
      LOOP
   ENDIF
   GO TOP
*   LOCA FOR subs(country,1,5) = subs(vname,1,5)
   seek  subs(vname,1,7)
   IF .NOT. EOF()
      SET COLO TO W+*/R
      @ 24,0 CLEA
      @ 24,7 SAY 'This Country is already exist, press any key to continue ..!'
      @ 23,0 SAY ''
      WAIT ''
      REST SCREEN FROM vscreen1
      LOOP
   ENDIF
   @ 15,26 GET vcode PICT '@!'
   READ
   IF vcode = SPACE(4)
      REST SCREEN FROM VSCREEN1
      LOOP
   ENDIF
   GO TOP
   LOCA FOR nat_code = vcode
   IF .NOT. EOF()
      SET COLO TO W+*/R
      @ 24,0 CLEA
      @ 24,10 SAY 'This Nationality Code is already exist, press any key to continue ..!'
      @ 23,0 SAY ''
      WAIT ''
      REST SCREEN FROM vscreen1
      LOOP
   ENDIF
   @ 16,26 GET vciti PICT '@!'
   READ
   IF FIL_LOCK()
      APPE BLANK
      IF REC_LOCK()
         REPL country WITH vname,nat_code WITH vcode
         repl citizenm with vciti,citizenf with vciti
         repl nat_fre with '1'
      ENDIF
      UNLOCK
   ENDIF
   EXIT
ENDDO

NATK=vcode
PATNATM=vciti
PATNATF=vciti
RELE ALL LIKE V*
RETURN
